import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    component: () => import("../views/home"),
  },
  {
    path: "/post",
    component: () => import("../views/post"),
  },
  {
    path: "/hotel",
    component: () => import("../views/hotel"),
  },
  {
    path: "/hotel/detail/:id",
    component: () => import("../views/hotel/detail.vue"),
  },
  {
    path: "/hotel/property",
    component: () => import("../views/hotel/detail.vue"),
  },
  {
    path: "/hotel/property/:id",
    component: () => import("../views/hotel/detail.vue"),
  },
  {
    path: "/hotel/propertyDetail/:id",
    component: () => import("../views/hotel/property.vue"),
  },
  {
    path: "/air",
    component: () => import("../views/air"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
